//调用接口配置文件
import { request } from 'config/request'

// 详情
export async function getDetail (params) {
  return request({
    url: 'admin/seckillActivity/admainDetail',
    method: 'POST',
    data: params
  })
}
// 活动已关联时间
export async function timeList (params) {
  return request({
    url: 'admin/seckillActivity/admainDetailList',
    method: 'POST',
    data: params
  })
}

// 活动未关联时间
export async function queryProductByType (params) {
  return request({
    url: 'admin/seckill/queryProductByType',
    method: 'GET',
    data: params
  })
}

// 新增
export async function create (params) {
  return request({
    url: 'admin/seckillActivity/create',
    method: 'POST',
    data: params
  })
}

// 修改
export async function update (params) {
  return request({
    url: 'admin/seckillActivity/update',
    method: 'POST',
    data: params
  })
}
// 修改
export async function createTimeSlot (params) {
  return request({
    url: 'admin/seckill/createTimeSlot',
    method: 'POST',
    data: params
  })
}
//解除时间关联
export async function relieveTimeSlot (params) {
  return request({
    url: 'admin/seckill/relieveTimeSlot',
    method: 'POST',
    data: params
  })
}
export async function invalidStatus (params) {
  return request({
    url: 'admin/seckill/invalidStatus',
    method: 'POST',
    data: params
  })
}
//解除时间关联
export async function updatePublished (params) {
  return request({
    url: 'admin/seckillActivity/updatePublished',
    method: 'POST',
    data: params
  })
}
//地址
export async function queryAllAddress (params) {
  return request({
    url: 'admin/address/queryAllAddress',
    method: 'GET',
    data: params,
  });
}
//账号指定https://admin-zmzj-sit.mideazy.com/admin/seckillActivity/admainDetail
export async function designated (params) {
  return request({
    url: 'admin/seckil/appoint/create',
    method: 'POST',
    data: params,
  });
}
//账号指定
export async function getDesignatedList (params) {
  return request({
    url: `admin/seckill/appoint/detail/${params.seckillProductId}`,
    method: 'GET',
  });
}
//删除指定
export async function deleteDesignated (params) {
  return request({
    url: `admin/seckil/appoint/delete/${params.seckillAppointId}`,
    method: 'GET',
  });
}

//区域列表
export async function queryAddressList(params) {
  return request({
    url: '3rd/commission/getRegion',
    method: 'GET',
    data: params,
  });
};
//选中适用
export async function scopeList(params) {
  return request({
    url: 'admin/seckillActivity/product/scope/list',
    method: 'POST',
    data: params,
  });
};